<%layout("/eova/layout/default.html",{'title' : '附件列表'}){%>

<body>
	<div></div>

	<div style="float: left; width: 100%">
		<table id="table-attachment" class="easyui-datagrid"
			data-options="rownumbers:true,singleSelect:true,method:'post',url:'/attachment/get/${file_id!}',toolbar:toolbar">
			<thead>
				<tr>
					<th id="th_id" data-options="field:'id',width:50">编号</th>
					<th data-options="field:'name',width:500">附件名称</th>
				</tr>
			</thead>
		</table>
	</div>

	<script type="text/javascript">
		var toolbar = [ {
			text : '查看',
			iconCls : 'icon-add',
			handler : function() {
				var grid = $('#table-attachment');
				var row = grid.datagrid('getSelected');
				if (row.id > 0) {
					window.open('/attachment/view_gw/' + row.id);
				}
			}
		}, '-', {
			text : '下载',
			iconCls : 'icon-save',
			handler : function() {
				var grid = $('#table-attachment');
				var row = grid.datagrid('getSelected');
				if (row.id > 0) {
					window.open('/efiles/download/' + row.id);
				}
			}
		} ];
	</script>

	<script>
		$(function() {
			/*
			var data = '${json!}';
			data = $.parseJSON(data);
			$('#table-attachment').datagrid('loadData', data);
			$('#table-attachment').datagrid('reload');
			 */
		});
	</script>

</body>

<%}%>
